[Prism] Fix panic in teststream - #36227
Conversation
Summary of ChangesHello @shunping, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug that caused a runtime panic in the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Assigning reviewers: R: @jrmccluskey for label go. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
I have seen the following panic in one of the precommit test logs ( https://github.com/apache/beam/actions/runs/17888682703/job/50866217521?pr=36226).
Basically, there are a few cases where
updateWatermarkswill return a nil set(map). For example:beam/sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go
Line 2101 in 3659832
For most references of
updateWatermarks, the returned map are read not written. The one in teststream, however, is an exception. Within there, we try to insert an element to this returned set(map), which leads to a panic if the set(map) is nil.beam/sdks/go/pkg/beam/runners/prism/internal/engine/teststream.go
Lines 255 to 256 in 3659832
Here is a note from go blog (https://go.dev/blog/maps#declaration-and-initialization):